<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  
<html xmlns = "http://www.w3.org/1999/xhtml">
  <!-- 2012 lukbrasil -->
  <!-- Internet & World Wide Web How To Program - Exercise 8.06 -->
  <head>
    <title>Exercise 8.06</title>
    
    <script type = "text/javascript">
      <!--
      var total = parseInt(window.prompt("Enter the number of values to be input"));
      var smallest = -1;
      var number;
      
      for (var count = 0; count < total; ++count) {
        number = parseInt(window.prompt("Enter an integer"));
        
        if (number > 0 && (smallest == -1 || number < smallest)) {
          smallest = number;
        }
      } 
      
      if (smallest != -1) {
        document.writeln("<p>The smallest non-negative integer is " + smallest + "</p>");
      }
      // -->
    </script>
  </head>
  <body>
  </body>
</html>
